package com.dh.basic;

import org.junit.Test;

public class TestSplit {

    @Test
    public void testSplit() {
        byte  b1[] = {0x01};
        byte  b2[] = {0x02};
        String str1 = new String(b1);
        String str2 = new String(b2);
        System.out.println(str1);
        System.out.println(str2);
        System.out.println("\u0001".equals(str1));
        System.out.println("\u0002".equals(str2));

        String msg ="f4087d7847c34aeabbf2e440c3fe987d\u0001202009010901087964079051\u0001202009011712094234079051\u00011598951502" +
                "-1522468\u0001202009010900112621126251\u0001\u000101\u000101\u00013\u000101\u00012020-09-01 17:12:08\u00012020-09-01 17:12:36\u0001\u00010\u000116625160928\u00010757967577\u000116625160928\u00011\u0001NO_RECORD_FILE\u000128\u0001GUDFS00221\u0001967577\u000140790\u0001640585\u0001\u00010\u00010\u00010\u0001\u0001\u0001\u0001\u0001\u00012020-09-01 17:12:08\u0001\u0001\u00012020-09-01 17:12:36\u0001f5d48351504b40a2b14341ba68b67c74\u000151\u0001UNICOM\u0001唐林珂\u00016\u0001300\u00010755\u000151\u0001\u0001\u0001202009\u000101\u0001";

        String split = "[\u0001]";
        String[] ms = (msg).split(split,-1);
        System.out.println(ms.length);

        String test = "1__1_";
        System.out.println(test.split("_",-1).length);
        System.out.println(test.split("_").length);
    }
}
